<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 把输入的内容转换成数字 -->
        <input type="text" v-model.number="num1">
        <span>+</span>
        <input type="text" v-model.number="num2">
        <span>= {{ num1 + num2 }}</span>

        <hr>
        <!-- <input type="text" v-model.trim="msg"> -->
        <!-- 要等你输入完了，才把输入内容给msg -->
        <!-- <input type="text" v-model.lazy="msg"> -->
        <input type="text" v-model.lazy.trim="msg">
        <p>{{ msg }}</p>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    num1: 0,
                    num2: 0,
                    msg: ''
                }
            },
        })
    </script>
</body>
</html>